<template>
<div>
  <h2>Movie组件</h2>
  <h2>num:{{num}}</h2>
<!--  1.直接通过$store.dispatch提交数据-->
  <button @click="$store.dispatch('incrementWait',{n:100})">累加--actionsDispatch</button>
<!--  2.通过辅助函数提交数据-->
  <button @click="incrementWait({n:1000})">累加--mapActions辅助函数</button>
</div>
</template>

<script>
import {mapActions, mapState} from "vuex";

export default {
  name: "Movie",
  methods:{
    ...mapActions(['incrementWait'])
  },
  computed:{
    ...mapState(['num'])
  }
}
</script>

<style scoped>

</style>